import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_ok/page/home/monitor_page.dart';
import 'package:flutter_ok/page/home/my_page.dart';
import 'package:flutter_ok/widget/keep_alive_page.dart';
import 'package:get/get.dart';

class HomeController extends GetxController {
  var mSelectedIndex = 0.obs;

  final List<BottomNavigationBarItem> mBottomTabs = [
    BottomNavigationBarItem(
      icon: Icon(CupertinoIcons.home),
      label: 'monitor'.tr,
    ),
    BottomNavigationBarItem(
      icon: Icon(CupertinoIcons.search),
      label: 'my'.tr,
    ),
  ];

  final List mPageList = [
    keepAliveWrapper(MonitorPage()),
    keepAliveWrapper(MyPage()),
  ];

  ///切换tab
  void switchTab(int index) {
    mSelectedIndex.value = index;
  }

}
